package com.ebring.shareEducation.service.impl;

import com.ebring.shareEducation.bean.CompanyPay;
import com.ebring.shareEducation.dao.CompanyPayBillMapper;
import com.ebring.shareEducation.service.CompanyPayService;
import com.ebring.shareEducation.utils.RspMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CompanyPayServiceImpl implements CompanyPayService {
    @Autowired
    private CompanyPayBillMapper companyPayBillMapper;

    @Override
    public RspMsg<CompanyPay> insertCompanyPayBill(CompanyPay companyPay) {
        RspMsg<CompanyPay> rspMsg = new RspMsg<>();
        int insert = companyPayBillMapper.insertSelective(companyPay);
        if(insert>0){
            rspMsg.setOK();
        }else{
            rspMsg.setError();
        }
        return rspMsg;
    }

    @Override
    public RspMsg<CompanyPay> updateCompanyPayBill(CompanyPay companyPay) {
        RspMsg<CompanyPay> rspMsg = new RspMsg<>();
        int i = companyPayBillMapper.updateByPrimaryKeySelective(companyPay);
        if(i>0){
            rspMsg.setOK();
        }else{
            rspMsg.setError();
        }
        return rspMsg;
    }
}
